fix(pipeline): say what actually failed, and guard against dead modules - #281
Merged
Conversation
Two things, the second found while fixing the first. Trigger failures now carry their reason to the card. Every failing card read "Execution failed" while the real reason existed only in a log — `git push --force failed: fatal: 'origin' does not appear to be a git repository`, for instance. `create_pr`, `run_script` and the managed-turn completion all called `mark_complete` with no detail, so the generic fallback was what the user saw. Each now passes one: - create_pr keeps the error it was previously only logging and emitting as an ephemeral Tauri event (which helps only if a panel is mounted). - run_script names the step: "Step 'lint' failed: exited 1", rather than leaving you to guess which of six steps it was. - the managed turn reports the CLI and exit code. `failure_message()` applies the generic string only when there genuinely is no reason, and treats blank or whitespace-only detail as absent — otherwise a card could store an empty error that renders as no error at all. ~1,165 lines of pipeline Rust are never compiled. While fixing the above I edited `pipeline/completion.rs`, added a test, and watched it not run. `completion.rs`, `engine.rs`, `events.rs`, `exit.rs` and `test_utils.rs` have no `mod` declaration anywhere: commit 234a992 "Split pipeline/mod.rs" created them and never wired them up, so the split silently never took effect. `mod.rs` kept the live implementation, and duplicate copies of `decide_completion` and `mark_complete_with_error` have sat beside it ever since. The trap is that it all reads like production code. `cargo build` passes, `clippy` passes, the file looks live, and editing it changes nothing at runtime. The real fix went into `pipeline/mod.rs`. `scripts/check-rust-modules.js` now fails CI on any `.rs` file no `mod` declaration reaches, with the five known ones in a documented `KNOWN_DEAD` allowlist so new files are still guarded. It also fails if that list names a file that no longer exists, so it shrinks rather than rots. Directories holding no Rust (`db/migrations/`, which is .sql read at runtime) are skipped. Deleting the five or finishing the split is a call for whoever owns that refactor — declaring them as-is will not build, since the symbols are duplicated. Filed on the roadmap.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two things — the second found while fixing the first, and it's the bigger one.
1. Trigger failures now carry their reason to the card
Every failing card read "Execution failed" while the real reason existed only in a log:
create_pr,run_scriptand the managed-turn completion all calledmark_completewith no detail, so the generic fallback was what the user saw. Each now passes one:Step 'lint' failed: exited 1, instead of leaving you to guess which of six steps it was.failure_message()applies the generic string only when there genuinely is no reason, and treats blank/whitespace-only detail as absent — otherwise a card could store an empty error that renders as no error.Worth noting: that reason is visible at all only because #276 installed a logger. Before this session it was discarded outright.
2. ~1,165 lines of pipeline Rust are never compiled
While fixing the above I edited
pipeline/completion.rs, added a test, and watched it not run.completion.rs,engine.rs,events.rs,exit.rsandtest_utils.rshave nomoddeclaration anywhere. Commit234a992"Split pipeline/mod.rs" created them and never wired them up — the split silently never took effect.mod.rskept the live implementation, and duplicate copies ofdecide_completionandmark_complete_with_errorhave sat beside it ever since.The trap is that it all reads like production code:
cargo buildpasses,clippypasses, and editing it changes nothing at runtime. The real fix went intopipeline/mod.rs.scripts/check-rust-modules.jsnow fails CI on any.rsfile nomoddeclaration reaches:The five known files sit in a documented
KNOWN_DEADallowlist so new files are still guarded. The check also fails if that list names a file that no longer exists, so it shrinks rather than rots. Directories holding no Rust (db/migrations/, which is.sqlread at runtime) are skipped.Decision needed from you, not me: delete the five, or finish the split. Declaring them as-is will not build — the symbols are duplicated. Filed as roadmap 2b.
Checks
cargo clippy -D warnings·cargo test --lib570 (+1) ·tsc·eslint·test:ipc·test:type-scale·test:rust-modules(new) ·vitest444.